<?php
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

class SimplelistingViewAuthors extends JView
{


	function display($tpl = null)
	{
            global $mainframe, $context;
            $model =& $this->getModel();

            $document = & JFactory::getDocument();
            $params = &JComponentHelper::getParams( 'com_simplelisting');

            $uri	=& JFactory::getURI();
            $pathway =& $mainframe->getPathWay();
            $backlink = JRoute::_('index.php?option='.$option);
            $select_theme     = $params->get('select_theme', '');

            $items	 =& $this->get( 'Data');
            $total       =& $this->get( 'Total');
            $pagination  =& $this->get( 'Pagination' );

           require_once ( JPATH_COMPONENT . DS . 'models' . DS . 'authors.php');

            $this->assignRef('params',              $params) ;
            $this->assignRef('items',               $items);
            $this->assignRef('lists',               $lists);
            $this->assignRef('pagination',          $pagination);
            $this->assignRef('request_url',         $uri->toString());
            $this->assignRef('select_theme',        $select_theme);

            parent::display($tpl);
  }
    function getAuthors($author)
            {
            $db = & JFactory::getDBO();
            $query = 'SELECT COUNT(*) FROM #__simplelisting AS a'.
            ' WHERE a.id='.$author;
            $db->setQuery($query);
            $result = $db->loadResult();
            return $result;
            }
}
?>
